import { useState } from 'react'
import { Button, Input } from 'antd'
import ChildA from 'component/ChildA'
import ChildB from 'component/ChildB'
import checkboxImg from './img/checkbox.png'

const Home = () => {
  const [textA, setTextA] = useState('C')
  const [textB, setTextB] = useState('B')
  const [name, setName] = useState('dong')

  return (
    <>
      <Button onClick={() => setTextA(v => v + 'A')}>修改 A</Button>
      <Button onClick={() => setTextB(v => v + 'B')}>修改 B</Button>
      <img src={checkboxImg} alt="checkbox" />
      <Input value={name} onChange={e => setName(e.target.value)} />

      <ChildA text={textA} />
      <ChildB text={textB} />
    </>
  )
}

export default Home
